package com.shen.web.form;

import java.io.Serializable;

import com.shen.constant.SSHConstant;
import com.shen.utils.Page;

/**
 * 封装一些常用参数的formbean。
 * @author shen
 *
 */
public class ParamForm implements Serializable {
	private static final long serialVersionUID = 6018055230511839792L;
	
	/** ID数组  **/
	private String[] ids;
	/** 总页数 **/
	private int totalPage;
	/** 记录总数 **/
	private long resultSum;
	/** 当前页码 **/
	private int pageNo;
	/** 每页记录数  **/
	private int pageSize = SSHConstant.PAGESIZE;
	/** 所传的参数  **/
	private String parameterStr;
	



	/**
	 * 根据总记录数和每页显示条数，生成page对象。
	 * @param resultSum
	 * @param pagesize
	 * @return
	 */
	public Page getPage(int resultSum, int pagesize) {
		Page page = new Page(resultSum, pagesize);
		page.setPageNo(this.pageNo);
		return page;
	}


	/**
	 * @return the ids
	 */
	public String[] getIds() {
		return ids;
	}
	/**
	 * @param ids the ids to set
	 */
	public void setIds(String[] ids) {
		this.ids = ids;
	}
	/**
	 * @return the totalPage
	 */
	public int getTotalPage() {
		return totalPage;
	}
	/**
	 * @param totalPage the totalPage to set
	 */
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	/**
	 * @return the resultSum
	 */
	public long getResultSum() {
		return resultSum;
	}
	/**
	 * @param resultSum the resultSum to set
	 */
	public void setResultSum(long resultSum) {
		this.resultSum = resultSum;
	}
	/**
	 * @return the pageNo
	 */
	public int getPageNo() {
		return pageNo;
	}
	/**
	 * @param pageNo the pageNo to set
	 */
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * @return the parameterStr
	 */
	public String getParameterStr() {
		return parameterStr;
	}
	/**
	 * @param parameterStr the parameterStr to set
	 */
	public void setParameterStr(String parameterStr) {
		this.parameterStr = parameterStr;
	}
}
